home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / gd_io.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-28  |  1.1 KB  |  56 lines

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4.  
  5. #ifndef GD_IO_H
  6. #define GD_IO_H 1
  7.  
  8. #include <stdio.h>
  9.  
  10. #ifdef VMS
  11. #define Putchar gdPutchar
  12. #endif
  13.  
  14. typedef struct gdIOCtx
  15. {
  16.   int (*getC) (struct gdIOCtx *);
  17.   int (*getBuf) (struct gdIOCtx *, void *, int);
  18.  
  19.   void (*putC) (struct gdIOCtx *, int);
  20.   int (*putBuf) (struct gdIOCtx *, const void *, int);
  21.  
  22.   /* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */
  23.   int (*seek) (struct gdIOCtx *, const int);
  24.  
  25.   long (*tell) (struct gdIOCtx *);
  26.  
  27.   void (*gd_free) (struct gdIOCtx *);
  28.  
  29. }
  30. gdIOCtx;
  31.  
  32. typedef struct gdIOCtx *gdIOCtxPtr;
  33.  
  34. void Putword (int w, gdIOCtx * ctx);
  35. void Putchar (int c, gdIOCtx * ctx);
  36.  
  37.  void gdPutC (const unsigned char c, gdIOCtx * ctx);
  38.  int gdPutBuf (const void *, int, gdIOCtx *);
  39.  void gdPutWord (int w, gdIOCtx * ctx);
  40.  void gdPutInt (int w, gdIOCtx * ctx);
  41.  
  42.  int gdGetC (gdIOCtx * ctx);
  43.  int gdGetBuf (void *, int, gdIOCtx *);
  44.  int gdGetByte (int *result, gdIOCtx * ctx);
  45.  int gdGetWord (int *result, gdIOCtx * ctx);
  46.  int gdGetInt (int *result, gdIOCtx * ctx);
  47.  
  48.  int gdSeek (gdIOCtx * ctx, const int offset);
  49.  long gdTell (gdIOCtx * ctx);
  50.  
  51. #endif
  52.  
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56.